#include "myTime.h"

void getNowTime(void)
{
	time_t time_T;
    time_T = time(NULL);

    struct tm *tmTime;
    // tm对象格式的时间
    tmTime = localtime(&time_T);

    //printf("Now Time is: %d:%d:%d\n", (*tmTime).tm_hour, (*tmTime).tm_min, (*tmTime).tm_sec);

    char* format = "%Y-%m-%d %H:%M:%S";
    char strTime[100];
    strftime(strTime, sizeof(strTime), format, tmTime);

    //printf("Time is :%s\n", strTime);
	UsartPrintf(USART_DEBUG, "时间:%s\r\n",strTime);
 
}
